package web.ling.por

class Application {

    ProofreadingOrder order
    Provider provider
    BigDecimal price
    Date canStart
    Date canFinish

    static belongsTo = [order: ProofreadingOrder]

    static constraints = {
        provider nullable: false, unique: ['order']
        price nullable: false, range: 1..10000
        canStart nullable: false, validator: {val, inst ->
            val >= new Date().clearTime()
        }
        canFinish nullable: false, validator: {val, inst ->
            val >= inst.canStart
        }
    }
}
